import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store/index'


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/admin/login/login')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/admin/home'),
    redirect:'/home/welcome',
    children:[
      //默认页面
      {
        path: 'welcome',
        name: 'welcome',
        component: () => import('@/admin/one/welcome'),
      },
      //后台首页
      {
        path: 'htsy',
        name: 'htsy',
        component: () => import('@/admin/one/htsy'),
        meta:{
          bread:['后台首页']
        }
      },
       //相册管理
      {
        path: 'xcgl',
        name: 'xcgl',
        component: () => import('@/admin/one/xcgl'),
        meta:{
          bread:['相册管理']
        }
      },
      //商品列表
      {
        path: 'shoplist',
        name: 'shoplist',
        component: () => import('@/admin/shop/shoplist'),
        meta:{
          bread:['商品','商品列表']
        }
      },
      //分类列表
      {
        path: 'fenlist',
        name: 'fenlist',
        component: () => import('@/admin/shop/fenlist'),
        meta:{
          bread:['商品','分类列表']
        }
      },
      //订单管理
      {
        path: 'ddgl',
        name: 'ddgl',
        component: () => import('@/admin/dd/ddgl'),
        meta:{
          bread:['订单','订单管理']
        }
      },
      //发票管理
      {
        path: 'fpgl',
        name: 'fpgl',
        component: () => import('@/admin/dd/fpgl'),
        meta:{
          bread:['订单','发票管理']
        }
      },
      //会员列表
      {
        path: 'hylb',
        name: 'hylb',
        component: () => import('@/admin/vip/hylb'),
        meta:{
          bread:['会员','会员列表']
        }
      },
      //会员等级
      {
        path: 'hydj',
        name: 'hydj',
        component: () => import('@/admin/vip/hydj'),
        meta:{
          bread:['会员','会员等级']
        }
      },
      //基础设置
      {
        path: 'jc',
        name: 'jc',
        component: () => import('@/admin/shezhi/jc'),
        meta:{
          bread:['设置','基础设置']
        }
      },
      //物流设置
      {
        path: 'wl',
        name: 'wl',
        component: () => import('@/admin/shezhi/wl'),
        meta:{
          bread:['设置','物流设置']
        }
      },
    ],
  },
  {
    path:'/',
    redirect:'/login'
  }

]

const router = new VueRouter({
  routes
})

export default router
